The present invention relates to a technology for comparing feature quantities of image data of a target document with feature quantities of image data of reference images stored beforehand to thereby identify the target document. More particularly, this invention relates to a technology which can prevent mis-identification due to variation in the image, thereby enabling accurate identification of various documents, when documents are identified by using a ruled line which is an intrinsic feature of documents.
In many countries, including Japan, China, it is common to use name seals instead of signature. For example, when applying for opening a bank account it is common in these countries to print the name seal instead of making a signature. It is also common to verify the authentication of the name seal printed on the application form with an already obtained print of the name seal of the same person either visually or using a computer. Conventionally, when different kinds of documents are subjected to verification of name seals or recognition of characters within the documents, because the documents may have different formats, it becomes first necessary to each time identify the type of each of the document every time and then perform the verification of the name seal or character recognition depending upon the identified format.
Generally, a identification code or identification mark is printed beforehand at a predetermined position in each document. This identification code or identification mark is confirmed to thereby identify the type of the document. However, since the rule for adding the identification code or identification mark is not always agreed upon between companies, it may happen that the document cannot be identified accurately with only this identification code or identification mark.
A technique for discriminating various documents without depending on the identification code or identification mark is also known. For example, in Japanese Unexamined Patent Publication No. Hei 4-268685, there is disclosed a method of discriminating the type of the document in which segments in the horizontal and vertical directions of ruled lines are extracted from input document image data and divided into a plurality of areas, and the data is subjected to vector patterning, using the direction, length and position of the segment extracted for each area to thereby be compared and verified with a feature vector in a standard pattern.
However, when the segment is extracted and designated as a feature quantity as in the related art, the segment may be broken off due to the quality of the image, for example, due to the property of the scanner, rotation correction or the like. Therefore, if the distance between segments is below a certain threshold, it is necessary to perform interpolation processing or the like for connecting two segments.
The distance between these two segments, however, changes based on the quality the image. When the distance between segments is close to the threshold value, there is a possibility in the interpolation processing that a different operation is performed at the time of extracting the feature quantity of the reference image and at the time of identification processing, thereby causing a problem in that documents cannot be identified accurately.
Specifically, when the processing for interpolating the segment broken off due to the property of the scanner or rotation correction is performed, since segments within a predetermined distance are connected, there is a possibility that not only the broken segment but also originally separate two segments are connected. For example, each rectangular frame of a postal code block in the address box in the document shown in FIG. 6 may be understood as two straight lines in the horizontal direction, to perform an operation different from that of at the time of registration (connection processing may be performed or not), and hence a change in the feature quantity is large, and the performance is unstable.
Therefore, when the document is identified, using a ruled line that is an intrinsic feature of the document, the important problem of how to increase the identification accuracy that decreases due to the bad image quality needs to be given consideration.
It is an object of this invention to provide a document identification apparatus and document identification methods that can identify documents accurately, while preventing a decrease in the identification accuracy resulting from a change in an image or the like, when various documents are identified using a ruled line which is an intrinsic feature of documents, and a computer readable recording medium recording a program for a computer to execute these methods.
The document identification apparatus, according to a one aspect of this invention, for discriminating various documents by comparing a feature quantity of image data of an input image of a document with a feature quantity of image data of at least one reference image stored beforehand, the document identification apparatus comprises a calculation unit which calculates a black pixel ratio, which black pixel ratio is a ratio of black pixels existing in a predetermined number of continuous pixels in horizontal or vertical direction from a specific pixel in the image data of the input image or the reference image; and an extraction unit which divides the image data into a plurality of blocks, and separately adds the black pixel ratios corresponding to every pixel located in every block to extract a feature quantity of the image data.
The document identification method, according to another aspect of this invention, for discriminating various documents by comparing a feature quantity of image data of an input image of a document with a feature quantity of image data of at least one reference image stored beforehand, the document identification method comprises a calculation step of calculating a black pixel ratio, which black pixel ratio is a ratio of black pixels existing in a predetermined number of continuous pixels in horizontal or vertical direction from a specific pixel in the image data of the input image or the reference image; and an extraction step of dividing the image data into a plurality of blocks, and separately adding the black pixel ratios corresponding to every pixel located in every block to extract a feature quantity of the image data.
According to the present invention, the black pixel ratio showing the ratio of black pixels existing in a predetermined number of pixel rows respectively linked together horizontally or vertically is calculated, for each pixel, from each pixel of image data of the input image or the reference image, the image data is divided into a plurality of blocks, and the black pixel ratio in each pixel located in a block is added for each divided block, to extract a feature quantity of the image data. Therefore, even if variable factors such as a change in information of a ruled line in the input image or handwritten characters are included, a stable feature quantity can be obtained, and hence there is such an effect that a document identification apparatus that can identify the type of the document accurately can be obtained.
The computer readable recording medium, according to still another aspect of this invention, stores a computer program that includes instructions which when executed on a computer realizes the document identification method.
Other objects and features of this invention will become apparent from the following description with reference to the accompanying drawings.